package com.dslcode.cloud.common.model;

import lombok.Data;

import java.io.Serializable;

/**
 * Created by dongsilin on 2017/9/21.
 */
@Data
public class BaseModel implements Serializable {

    public static final long serialVersionUID = 1L;
    private Long id;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BaseModel baseModel = (BaseModel) o;

        return id.equals(baseModel.id);
    }

    @Override
    public int hashCode() {
        return id.hashCode();
    }
}
